@extends('site.base')

@section('style')
<style>

	.post{
		padding: 2em;
		display: block;
		background-color: #FFF;
		margin: 2em;	
	}
	
	.post-title .post-content .post-cover{			
		padding:1em;	
	}
	
	.post-title{
		font-family: "maiandra gd";	
		font-size: 2.5em;
		text-align: center;
	}
	
	.post-cover{
		padding: 2em 1em 2em 1em;	
	}
	
	.post-content{
		text-align: justify;
		font-size: 1em;
		font-family: "maiandra gd";	
	}
			
	.sidebar-section{		
		padding: 2em;
		background-color: #FFF;
		margin-top: 2em;				
	}
	
</style>
@endsection

@section('body-content')
<div class="container">
	<aside class="col-md-8" id="left-side">			
			@foreach($articles as $article)
			<div class="post">			
			<article>
				<div class="post-title">{{ $article->title }}</div>
				<div class="post-cover"><img class="center-block img-responsive" src="{{asset($article->cover_url)}}" /> </div>
				<div class="post-content"><?php echo $article->subContent ?></div>
				<hr />
				<a href="{{ 'article/'.$article->id }}" class="btn btn-success">阅读全文</a>
				{{ date('Y-m-d',strtotime($article->created_at))}}
			</article>
			</div>	
			@endforeach		
	</aside><!--/.left side-->
	<aside class="col-md-3" id="right-side">		
		<section id="tagCloud" class="sidebar-section">
			<h2>
				标签云
			</h2>
			<hr />
			<div>
				<a href="{{ URL('article/search')}}">
					laravel
				</a>
				<a href="">
					Web
				</a>
			</div>
		</section>
		<section id="followMe" class="sidebar-section">
			<h2>
				关注我
			</h2>
			<hr />
			<div>
				<img src="{{ asset('/img/erwei.png')}}" style="width: 100%;"/>
			</div>
		</section>
		<section id="recentArticles" class="sidebar-section">
			<h2>
				全部分类
				 <span class="glyphicon glyphicon-th-list">			
			</h2>
			<hr />
			<div>
				@foreach($categorys as $category)
				<a href="{{ URL('article/category/'.$category->id)}}" style="display: block; border-bottom: 1px dotted crimson;">
					{{ $category->category }}
				</a>
				@endforeach
			</div>
		</section>
		
	</aside><!--/.right side-->
</div>
@endsection